package cn.yours.web.context;

/**
 * ThreadLocal会将当前线程开启一个存储空间，只有在该线程情况下才会获得该空间储存的值
 */
public class BaseContext {

    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
